/*
 * nwpu/2012/2012_5.c
 *
 * Harry Wei <harryxiyou@gmail.com> (C) 2013
 */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>

#define NUMS		(1024)

int main(int argc, char argv[]) {
	unsigned char text1[NUMS];
	unsigned char text2[NUMS];
	unsigned char *scan = NULL;
	int letter = 0;
	int digital = 0;
	int space = 0;
	int other = 0;
//	int temp = 0;

	memset(text1, '\0', NUMS);
	memset(text2, '\0', NUMS);
	setbuf(stdin, text2);
	fscanf(stdin, "%s\n", text1);
	printf("text1: %s\n", text1);
	printf("text2: %s\n", text2);
	scan = text2;
	while ('\n' != (*scan)) {
		printf("%c ", *scan);
//		temp = atoi(scan);
#if 1
		if (('a' <= *scan && 'z' >= *scan) ||
			('A' <= *scan && 'Z' >= *scan)) {
			printf("alpha: %c\n", *scan);
			letter += 1;
		} else if ('0' <= *scan && '9' >= *scan) {
			printf("digit: %c\n", *scan);
			digital += 1;
		} else if (' ' == *scan) {
			printf("space: %c\n", *scan);
			space += 1;
		} else {
			printf("other: %c\n", *scan);
			other += 1;
		}
#endif
		scan += 1;
	}
	printf("\n");
	printf("letter: %d, digital: %d, space: %d, other: %d\n", letter, digital, space, other);
	return 0;
}